﻿using System;
using System.Globalization;
using System.Windows.Data;
namespace CoreModule
{
    /// <summary>
    /// 
    /// </summary>
    public class ViewportFontSizeConverter : IValueConverter
    {
        public double Scale { get; set; } = 0.05;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            
            double viewportWidth = (double)value;
            double baseFontSize = viewportWidth * Scale; // 10% of viewport width
            if (baseFontSize <= 0)
            {
                return 16;
            }
            return baseFontSize;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
